package com.linjuke.childay.common;

import java.io.UnsupportedEncodingException;

import com.linjuke.childay.util.StringUtil;

public class EncodeUtil {
	
	public static String transCharset(String target, String inputCharset, String ouputCharset) {
		if (StringUtil.isEmpty(target)) {
			return target;
		}
		try {
			return new String(target.getBytes(inputCharset), ouputCharset);
		} catch (UnsupportedEncodingException e) {
			throw new RuntimeException(e);
		}
	}

}
